#!/bin/bash

brokers='192.168.24.129 192.168.24.130 192.168.24.131'
KAFKA_HOME='/usr/kfk/kafka_2.12-0.11.0.2'

echo -----INFO:Begin to stop kafka cluster--------
for broker in $brokers
do
	echo '-------INFO:shut down kafka on ${broker}--------'
	ssh $broker -C '${KAFKA_HOME}/bin/kafka-server-stop.sh'
	if [ $? -eq 0 ];then
		echo '--------INFO:[${broker}] shut down completed-----'
	fi
done
echo '-----INFO: kafka shut down completed ----------'